package FIT;

//Bui Duc Duy lop: k61B 
public class Account {
	private long soTK;
	private String tenTK;
	private double soTien;
	final double LAIXUAT=0.02d;
	
	public Account(){
		
	}
	
	public Account(long sotaikhoan, String tentaikhoan){
		this.soTK=sotaikhoan;
		this.tenTK=tentaikhoan;
	}
	
	public long getSotk(){
		return this.soTK;
	}
	public void setSotk(long soTK){
		this.soTK = soTK;
	}
	public String getTentk(){
		return this.tenTK;
	}
	public void setTentk(String tenTK){
		this.tenTK = tenTK;
	}
	public double getSotien(){
		return this.soTien;
	}
	public void setSotien(double soTien){
		this.soTien = soTien;
	}
	public void naptien(double sotiennap){
		soTien=soTien+sotiennap;
	}
	public void ruttien(double sotienrut, double phirut){
		if(soTien>(sotienrut+phirut))
			soTien=soTien-(sotienrut+phirut);
	}
	public void daohan(){
		soTien=soTien+soTien*LAIXUAT;
	}
	public void tostring(){
		System.out.println("So tai khoan la: " +soTK);
		System.out.println("Ten tai khoan la: " +tenTK);
		System.out.println("So tien trong tai khoan la: " +soTien);
	}
	public static void main(String[] args) {
		Account taikhoan = new Account();
		taikhoan.setSotk(75894388);
		taikhoan.setTentk("80 Nguyen Van An");
		taikhoan.setSotien(50000);
		taikhoan.tostring();
		System.out.println("Nap tien");
		taikhoan.naptien(500000);
		taikhoan.tostring();
		System.out.println("Rut tien");
		taikhoan.ruttien(100000,2000);
		taikhoan.tostring();
		System.out.println("Dao han");
		taikhoan.daohan();
		taikhoan.tostring();
	}

}
